#	m42-xmas-memory
#   Copyright (C) 2014  Jannik Haberbosch
#
#	This program is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.


import os
import os.path

import pygame
pygame.init()


WINDOW_WIDTH = 1024
WINDOW_HEIGHT = 768
WINDOW_DIMENSIONS = ( WINDOW_WIDTH, WINDOW_HEIGHT )


FPS = 25


DB_NAME = "m42memory"
DB_TABLE_SETTINGS = "settings" # fullscreen (boolean), music (boolean), sound( boolean)
DB_TABLE_PLAYER = "player" # name(text), nickname(text)
DB_TABLE_BOARD_SIZE = "board_size" # desc(text)
DB_TABLE_HIGHSCORE = "highscore" # moves(integer), id_board_size(integer, FK), id_player(integer, FK)

DB_TABLE_SETTINGS_CREATE = """
	CREATE TABLE IF NOT EXISTS %s
	(
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		fullscreen INTEGER,
		music INTEGER,
		sound INTEGER
	);
""" % DB_TABLE_SETTINGS

DB_TABLE_PLAYER_CREATE = """
	CREATE TABLE IF NOT EXISTS %s
	(
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		name TEXT,
		nickname TEXT
	);
""" % ( DB_TABLE_PLAYER )

DB_TABLE_BOARD_SIZE_CREATE = """
	CREATE TABLE IF NOT EXISTS %s
	(
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		board_size INTEGER,
		description TEXT
	);
""" % ( DB_TABLE_BOARD_SIZE )

DB_TABLE_HIGHSCORE_CREATE = """
	CREATE TABLE IF NOT EXISTS %s
	(
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		moves INTEGER,
		id_board_size INTEGER,
		id_player INTEGER,
		FOREIGN KEY(id_board_size) REFERENCES %s(id),
		FOREIGN KEY(id_player) REFERENCES %s(id)
	);
""" % ( DB_TABLE_HIGHSCORE, DB_TABLE_PLAYER, DB_TABLE_BOARD_SIZE )


GFX_PATH = os.path.join( os.getcwd(), "gfx" )
